package com.xxx.lib

import com.blankj.utilcode.util.FileUtils
import com.blankj.utilcode.util.PathUtils
import java.io.File

/**
 * 路径配置
 */
object PathConfig {
    /* -------------------------------- 根目录/Android/data/package 相关路径---------------------------------*/

    /**
     * App缓存文件夹路径，根目录/Android/data/package/cache
     */
    private val externalAppCachePath by lazy { PathUtils.getExternalAppCachePath() }

    /**
     * okhttp缓存文件夹路径，根目录/Android/data/package/cache/okhttp
     */
    val DIR_CACHE_OKHTTP by lazy {
        "${externalAppCachePath}${File.separator}okhttp"
            .also { FileUtils.createOrExistsDir(it) }
    }

    /**
     * glide缓存文件夹路径，根目录/Android/data/package/cache/glide
     */
    val DIR_CACHE_GLIDE by lazy {
        "glide"
            .also { FileUtils.createOrExistsDir("${externalAppCachePath}${File.separator}$it") }
    }


    /**
     * pictureselector压缩裁剪图片文件夹路径,根目录/Android/data/package/cache/pictureselector
     */
    val DIR_CACHE_PICTURESELECTOR by lazy {
        "${externalAppCachePath}${File.separator}pictureselector"
            .also { FileUtils.createOrExistsDir(it) }
    }
}